package org.flexthinker.binding.ui.form.binding
{
    /**
     * Object listening for notifications from the given <code>form</code>.
     * When a new field is being added to the UI, <code>fieldAdded</code> gets called.
     * When an existing field is removed from the UI, <code>fieldRemoved</code> gets called.
     *
     * Implementations of <code>BindingFieldFinder</code> should attach such listener implementation,
     * in order to be notified as new fields become available or get removed.
     */
    public interface BindingFieldFinderListener
    {
        /**
         * Method similar to <code>partAdded</code> method of <code>SkinnableComponent</code> of Flex SDK.
         * @param fieldName
         *          Name of the field that was added
         * @param instance
         *          Instance of the field
         */
        function fieldAdded(fieldName:String,  instance:Object):void;

        /**
         * Method similar to <code>partRemoved</code> method of <code>SkinnableComponent</code> of Flex SDK.
         * @param fieldName
         *           Name of the field that was removed
         * @param instance
         *              Instance of the field
         */
        function fieldRemoved(fieldName:String,  instance:Object):void;

    }
}
